#! /usr/bin/python
#
# Stephen Poletto (spoletto)
# Peter Wilmot (pbwilmot)
# CSCI1580 - Web Search
# Spring 2011 - Brown University
#

import sys

EPSILON = 1.0
outputFile = open('labelSVM.dat', 'wb')

num_docs = 0
testFile = open('test.dat', 'r')
for line in testFile:
    num_docs += 1
testFile.close()
    
files = []
for i in range(0, 11):
    files.append(open('prediction' + str(i) + '.dat'))
   
curr_line = 0
while curr_line < num_docs:
    for i in range(0, 11):
        line = files[i].readline()
        line = line.rstrip('\n')
        if line != '':
            docValue = float(line)
            if docValue > EPSILON:
                outputFile.write(str(i) + " ")
    outputFile.write("\n")
    curr_line += 1
    